#include "dirutils.h"

#include "stringutils.h"

bool DirFileList(const char *path, GSList **list) {
    DIR *dirp;
    struct dirent *entry;
    
    if ((dirp = opendir(path))) {
        entry = readdir(dirp);

        for (;entry != NULL; entry=readdir(dirp)) {
            *list = g_slist_append(*list, createBufferCopy(entry->d_name));   
        }

        closedir(dirp);
    } else return false;

    return true;
}